int selection_sort(int *data, int data_lenth)
{
	if (data == 0 || data_lenth <= 0)
	{
		return -1;
	}

	int i,j;
	int min;

	for (i = 0; i < data_lenth; i++)
	{
		min = i;
		for (j = i+1; j < data_lenth; j++)
		{
			if (data[j] < data[min])
			{
				min = j;
			}	
		}
		if ( min != i )
		{
			int temp;
			temp = data[min];
			data[min] = data[i];
			data[i] = temp;
		}
	}
}
